home *** CD-ROM | disk | FTP | other *** search
/ Just Call Me Internet / Just Call Me Internet.iso / prog / atari / asm / stkasm02 / stikincl.s < prev    next >
Encoding:
Text File  |  1997-04-21  |  2.0 KB  |  87 lines

  1.  
  2. COOKIEJAR    equ    $000005a0
  3.  
  4.     SECTION    TEXT
  5.  
  6. ****************************************
  7. * init routine to get pointers etc        *
  8. * should be run in SUPER                    *
  9. * return: d0=0  no stik found                *
  10. *         d0=-1 stik found but inactive*
  11. *      d0=-2 stik found but maybe             *
  12. *        corrupted                                *
  13. *      d0=-3 transport layer not found    *
  14. *        d0=1 ok stik (transport layer)*
  15. *              found.                                *
  16. ****************************************
  17. stik_init
  18.     move.l    COOKIEJAR.w,a0
  19.     tst.l        (a0)
  20.     beq.s        .no_jar_found
  21.     move.l    #"STiK",d0
  22. .zoek_koekie2    
  23.     tst.l        (a0)
  24.     beq.s        .no_stik_cookie
  25.     lea        8(a0),a0
  26.     cmp.l        -8(a0),d0
  27.     bne.s        .zoek_koekie2
  28.     move.l    -4(a0),stikpointer    ;stikpointer ophalen
  29.     bra.s        .stik_found              
  30. .no_jar_found
  31. .no_stik_cookie
  32.     clr.l        d0                            ;Stik not found
  33. .leave_stik_init    
  34.     move.l    d0,stik_status
  35.     rts
  36.  
  37. .acterror
  38.     move.l    #-2,d0
  39.     bra.s        .leave_stik_init
  40.  
  41. .stik_found
  42.     tst.l        stikpointer
  43.     bne.s        .stik_active
  44.     move.l    #-1,d0
  45.     bra.s        .leave_stik_init
  46.  
  47. .stik_active
  48.     move.l    stikpointer,a0            ;check the magic
  49.     cmp.l        #"STiK",(a0)
  50.     bne.s        .acterror
  51.     cmp.l        #"magi",4(a0)
  52.     bne.s        .acterror
  53.     cmp.w        #"c"*256,8(a0)
  54.     bne.s        .acterror
  55.  
  56.     move.l    10(a0),drvheader    ;pointer to drvheader routine
  57.     move.l    14(a0),etmexec        ;pointer to exec stik module routine
  58.     move.l    18(a0),stikconfig    ;pointer to stikconfig
  59.     move.l    22(a0),stikbasepage    ;pointer to stik basepage
  60.  
  61.     move.l    10(a0),a0            ;find transport layer module
  62.     pea        TRANSPORT_DRIVER
  63.     jsr    (a0)
  64.     lea        4(sp),sp
  65.     move.l    d0,tplpointer        ;pointer to transport structure
  66.  
  67.     tst.l        tplpointer
  68.     beq.s        .tplnotfound
  69.  
  70.     moveq        #1,d0    
  71.     bra.s        .leave_stik_init
  72.  
  73. .tplnotfound
  74.     move.l    #-3,d0
  75.     bra.s        .leave_stik_init
  76.  
  77.     SECTION    BSS
  78.  
  79. stikpointer        ds.l    1    ;pointer from stikcookie
  80. drvheader        ds.l    1    ;pointer to drvheader routine
  81. etmexec            ds.l    1    ;pointer to etm_exec routine
  82. stikconfig        ds.l    1    ;pointer to stik config struct
  83. tplpointer        ds.l    1    ;pointer to transport structure
  84. stikbasepage    ds.l    1    ;pointer to stik basepage
  85.  
  86.     SECTION    TEXT
  87.